rollout progress "dynamic loop" width:372 height:40
 (
 	progressBar pro "ProgressBar" pos:[4,26] width:362 height:9 color:(color 255 0 0) orient:#horizontal
 	label pro2 "" pos:[120,4] width:140 height:18
 
 ) 
 
 createdialog progress  


obj3=detachobj

	      list = $morphobj* as array
	      obj4=snapshot obj3
	      addmodifier obj3 (morpher())
	      WM3_MC_BuildFromNode obj3.morpher 1 obj4
	
	      animate on
	       (
	        at time 0
	         (
	          WM3_MC_SetValue obj3.Morpher 100 100.0
	        )
	     )

		  
		--  for i in 1 to list.count do
	      -- (
	      --  list[i]
	      --  WM3_MC_BuildFromNode obj3.morpher i list[i]
	     --  )
	
	     num=list.count+interim
	     num2=starttime+list.count-1
	     num3=starttime+list.count+interim-1
	     num4=list.count
	     beg=starttime
	     slidertime=beg-1
	     animate on
	      (
	       at time (beg-1)(WM3_MC_SetValue obj3.Morpher 1 0.0)
	      )
	     slidertime=beg
	     animate on
	     (
	      at time beg(WM3_MC_SetValue obj3.Morpher 1 100.0)
	     )
	     slidertime=beg
	     animate on
	     (
	      at time beg(WM3_MC_SetValue obj3.Morpher 2 0.0)
	     )
	     slidertime=num2
	     animate on
	     (
	      at time num2(WM3_MC_SetValue obj3.Morpher 1 0.0)
	     )
	     slidertime=num3
	     animate on
	     (
	      at time num3(WM3_MC_SetValue obj3.Morpher 1 100.0)
	     )
	     slidertime=num3
	     animate on
	     (
	      at time num3(WM3_MC_SetValue obj3.Morpher num4 0.0)
	     )
		 
	     n=2
	     for m=1 to (list.count-1) do
	     ( 
		   n2=n-1
	       n3=n+1
	       slidertime=beg+m
	       animate on
	         (
	          at time (beg+m)(WM3_MC_SetValue obj3.Morpher n2 0.0)
	         )
	       animate on
	         (
	          at time (beg+m)(WM3_MC_SetValue obj3.Morpher n 100.0)
	         )
	       animate on
	         (
	          at time(beg+m)(WM3_MC_SetValue obj3.Morpher n3 0.0)
	         )
	       n=n+1
		   
		   progress.pro.value=m*100./(list.count-1)
	       pro2=(m*100/(list.count-1)) as integer			
		   progress.pro2.text="processing:" + pro2 as string + "%"

		  )


  
  for i in 1 to list.count do
	       (
	        list[i]
	        WM3_MC_BuildFromNode obj3.morpher i list[i]
	       )
		   
		  progress.pro.value=0
          destroydialog progress 
		   
		   
